import http from '@/util/http.js';




//会员等级列表
export function rankList(pagination, param) {
	let url = `/vip/rank/list/${pagination.pageSize}/${pagination.current}`;
	return new Promise((resolve, reject) => {
		http.get(url, param).then(response => {
			resolve(response)
		});
	});
}

//新增会员等级
export function rankAdd(data) {
	let url = `/vip/rank/add`;
	return new Promise((resolve, reject) => {
		http.post(url, data).then(response => {
			resolve(response)
		});
	});
}
//根据会员等级ID修改会员等级
export function rankUpdate(id,data) {
	let url = `/vip/rank/update/${id}`;
	return new Promise((resolve, reject) => {
		http.put(url, data).then(response => {
			resolve(response)
		});
	});
}
//删除会员等级
export function rankDelete(id) {
	let url = `/vip/rank/delete/${id}`;
	return new Promise((resolve, reject) => {
		http.delete(url).then(response => {
			resolve(response)
		});
	});
}







//会员等级列表
export function profileList(pagination, param) {
	let url = `/vip/profile/list/${pagination.pageSize}/${pagination.current}`;
	return new Promise((resolve, reject) => {
		http.get(url, param).then(response => {
			resolve(response)
		});
	});
}

//新增会员等级
export function profileAdd(data) {
	let url = `/vip/profile/add`;
	return new Promise((resolve, reject) => {
		http.post(url, data).then(response => {
			resolve(response)
		});
	});
}
//根据会员等级ID修改会员等级
export function profileUpdate(id,data) {
	let url = `/vip/profile/update/${id}`;
	return new Promise((resolve, reject) => {
		http.put(url, data).then(response => {
			resolve(response)
		});
	});
}
//删除会员等级
export function profileDelete(id) {
	let url = `/vip/profile/delete/${id}`;
	return new Promise((resolve, reject) => {
		http.delete(url).then(response => {
			resolve(response)
		});
	});
}




//获取会员车辆列表
export function vehicleList(pagination, param) {
	let url = `/vip/vehicle/list/${pagination.pageSize}/${pagination.current}`;
	return new Promise((resolve, reject) => {
		http.get(url, param).then(response => {
			resolve(response)
		});
	});
}



//新增会员等级
export function vehicleAdd(data) {
	let url = `/vip/vehicle/add`;
	return new Promise((resolve, reject) => {
		http.post(url, data).then(response => {
			resolve(response)
		});
	});
}

//根据会员车辆ID修改车辆信息
export function vehicleUpdate(id,data) {
	let url = `/vip/vehicle/update/${id}`;
	return new Promise((resolve, reject) => {
		http.put(url, data).then(response => {
			resolve(response)
		});
	});
}

//删除会员车辆
export function vehicleDelete(id) {
	let url = `/vip/vehicle/delete/${id}`;
	return new Promise((resolve, reject) => {
		http.delete(url).then(response => {
			resolve(response)
		});
	});
}



//根据车辆ID解绑车辆和会员的关系数据
export function vehicleUnbind(id) {
	let url = `/vip/vehicle/unbind/${id}`;
	return new Promise((resolve, reject) => {
		http.put(url).then(response => {
			resolve(response)
		});
	});
}




//根据车辆ID解绑车辆和会员的关系数据
export function vehicleLicenseFind(vehicleId) {
	let url = `/vip/vehicle/license/${vehicleId}`;
	return new Promise((resolve, reject) => {
		http.get(url).then(response => {
			resolve(response)
		});
	});
}